// TOWN DIALOGUE SCRIPT
//    Town 138: Golddale

begintalkscript;

variables;

short i,j,k,r1,choice;

// Londo

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Londo";
	text1 = "A short, stocky man, mostly bald, sits behind the counter. He has several wickedly sharp knives, arrayed before him in a neat row.";
	text2 = "He inspects you with a sharp, analytical gaze. _I am Londo,_ he says in a thickly accented voice. _I am the teacher of Golddale._";
	text5 = "Londo looks across at you impatiently. _What it is you want?_";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What is your profession in Golddale?_";
	text1 = "_I am responsible for education in this filthy town. I teach the people who go to work in the mines._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Is teaching difficult?_";
	text1 = "_The mines are dangerous in the best of times. The poor workers must be told what to do at all times. I need to teach them a wide variety of skills. If you need training, I can help you too, for a fee._";

begintalknode;
	state = 2;
	nextstate = 4;
	question = "_I take it that you don't like being here?_";
	text1 = "_The dust constantly clogs my nose, and the dirt is always in my clothes! At least it's been better lately, because of all the troubles in the mines._";
	text3 = "_The dust constantly clogs my nose, and the dirt is always in my clothes! And now that you have cleared the mines, soon they will be settled again! My suffering resumes._";
	action = DEP_ON_SDF 138 0 3;

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_If it's so dangerous, why is mining going on here?_";
	text1 = "_The mines here have much gold and high quality iron deposits, which is excellent because Valorim is so much poorer than the rest of the Empire. However, there has been much in the way of troubles there lately._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_What troubles?_";
	text1 = "_The mines have been attacked by many, many dangerous monsters. I am not who you should ask about that, though. You should talk to Delenn. She runs the mines. Her office is nearby._";
	text3 = "_Now the troubles are not so much. We have you to thank for that. But they were considerable._";
	action = DEP_ON_SDF 138 0 3;

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_I'd like to train with you._";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Londo",
		  "Londo can provide a variety of safety and endurance tips, very helpful when exploring the mines.",
		  66,5,0);	
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_Then be moving on, thank you._";
	action = END_TALK;
	
// Delenn

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Delenn";
	text1 = "You meet a middle-aged woman with long dark hair and an air of command. She wears a long, flowing, modest dress.";
	text2 = "She stands and shakes your hands. _I am Delenn. Welcome to my office._";
	text5 = "Delenn smiles. _I see you wish to speak further. About what?_";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_May I inquire about your job?_";
	text1 = "_I run the Golddale Mining Company. Challenging, but rewarding work._";

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_How fares Golddale?_";
	text1 = "_A wealthy and peaceful town. Fortunately, we have suffered little at the hands of the troglodytes that have plagued the north._";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_What is it you mine?_";
	text1 = "_We pull gold and fine iron out of the mountains to the east. Unfortunately, lately the demands on us have been considerable. We have recently offered rewards for certain services._";
	text3 = "_We pull gold and silver out of the mountains to the east. Considering the poverty of much of Valorim, valuable metals are a great blessing to us._";
	action = DEP_ON_SDF 138 0 3;

begintalknode;
	state = 31;
	nextstate = -1;
	condition = gf(138,0) <= 3;
	question = "_What demands have been placed on you?_";
	text1 = "_There is much wealth in the ground, and many monsters interested in it. We often pay adventurers to undertake missions for us._";

begintalknode;
	state = 31;
	nextstate = -1;
	question = "_How will mining help pull Valorim out of poverty?_";
	text1 = "_It's very simple. We need precious metals to trade with the rest of the Empire for the supplies we need to grow. Without precious metals, Valorim will be a backwater forever._";

begintalknode;
	state = 31;
	nextstate = 32;
	condition = gf(138,0) <= 1;
	question = "_Perhaps I can help your situation._";
	code =
		run_hardcode(135);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(138,0) >= 3;
	question = "_What do you know of the ursagi?_";
	text1 = "_Bears can be a threat, but the ursagi are infinitely worse. They're the product of some wizard's insane experiment, escaped and gone wild._";
	text2 = "_They're intensely fierce, huge, intelligent, wicked bears. Be careful when dealing with them._";

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(138,0) == 1;
	question = "_What do you know of the lizard people?_";
	text1 = "_We've never seen their like. They're humanoid, intelligent lizards. They have their own language, magical spells, and these peculiar, two-tined spears. That is why I am glad to send a lizard person to fight them. You must know them better than we do._";
	text3 = "_We've never seen their like. They're humanoid, intelligent lizards. They have their own language, magical spells, and these peculiar, two-tined spears. Watch yourselves. They'll outwit you if you give them half the chance._";
	code =
		if (species_in_party(3))
			remove_string(3);
			else remove_string(1);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(138,0) == 2;
	question = "_Anything else I can do for you?_";
	code =
		run_hardcode(135);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(50,9) >= 1 && gf(138,0) == 1;
	question = "_I have killed the lizard chieftain, as you requested._";
	code =
		run_hardcode(135);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(138,0) == 3 && gf(51,11) > 0;
	question = "_I have killed the lord of the ursagi._ (Tell the tale.)";
	code =
		run_hardcode(135);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(138,0) >= 4;
	question = "_Are you paying any more bounties?_";
	code =
		run_hardcode(135);
	break;

// Ivanova

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "Ivanova";
	text1 = "This woman is piercingly beautiful. She has the air of one who is comfortable holding power. Her robes are simple and stylish, and she has two wands hanging from her belt.";
	text2 = "_I am Ivanova, sage by trade._";
	text5 = "Ivanova continues to chat with you, comfortable but alert. Her wands are always close to hand. She acts like the village might be attacked at any moment. _Yes? What else?_";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = -1;
	question = "_What are the wands for?_";
	text1 = "She looks down at them. _Self-protection. What else?_";

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_Greetings. What purpose do you serve?_";
	text1 = "_I am a sage by trade._ She grimaces. _I do a lot of metal analysis. It leaves little time for my ... well, my other studies._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_What sort of metal analysis are you called on to perform?_";
	text1 = "She looks impatient. _I figure out how much usable metal there is in the samples that are brought to me. What else would a sage by a mine do?_";

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_What are your other studies?_";
	text1 = "She looks at you shiftily. _I study teleportation a bit. Quite an interesting field of study, eh? In fact, if you wanted to undertake a little mission for me, the reward would be worth your while._";
	text3 = "She looks at you blankly. _Nothing that would concern you anymore._";
	action = DEP_ON_SDF 138 1 1;


begintalknode;
	state = 59;
	nextstate = 60;
	condition = gf(138,1) <= 1;
	question = "_Tell me about this mission of yours._";
	code =
		run_hardcode(136);
	break;

begintalknode;
	state = 60;
	nextstate = 57;
	condition = gf(138,1) <= 1;
	question = "_Do you know anything useful about Ernest?_";
	text1 = "_Ernest? He's a great combination. Successful and absent-minded! Even if he notices the loss of the book, he won't care!_";

begintalknode;
	state = 57;
	nextstate = -1;
	condition = gf(138,1) == 1 && has_spec_item(58) > 0;
	question = "_I stole the book on teleportation from Ernest._";
	code =
		run_hardcode(136);
	break;

// G'Kar

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 85;
	question = "G'Kar";
	text1 = "A nephilim male maintains the inn, keeping the bar clean with feline fastidiousness.";
	text2 = "He purrs at you in greeting. _I am G'Kar._";
	text5 = "G'Kar continues to carefully tend the bar. You notice that he is extremely servile to all of the human customers.";
	action = INTRO;

begintalknode;
	state = 85;
	nextstate = 86;
	question = "_A fine inn. What can be had here?_";
	text1 = "_Mrrrr. We have a fine room for only fifteen coins. Apologies ... we have none of our usual mead._";


begintalknode;
	state = 86;
	nextstate = 87;
	question = "_Why don't you have any mead?_";
	text1 = "He shrugs, in a smooth, feline way. _The monsters to the north have made merchants nervous about coming here. Thus, my usual sources of mead have dried up. Still looking for a new source._";

begintalknode;
	state = 87;
	nextstate = -1;
	question = "_Know anything about the monsters to the north?_";
	text1 = "_Troglodytes by Sharimik. Giants in Lorelei. Even heard rumors of golems to the northeast!_ He hisses. _Horrible days, to be sure._";

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_Is it dangerous to be a nephil in a human town?_";
	text1 = "_Mrrr. You must know personally some of the dangers of one of our kind walking these roads. But Delenn is kind and wise, and she lets me be here._";
	text3 = "_Mrrr. Delenn is kind and wise, and she lets me be here. She watches over me._";
	code =
		if (species_in_party(2))
			remove_string(3);
			else remove_string(1);
	break;


begintalknode;
	state = 85;
	nextstate = -1;
	condition = coins_amount() >= 15;
	question = "_I want a room._ Pay fifteen coins.";
	text1 = "He bows, takes your money, and gracefully shows you to the room. There's a fine layer of soot and dust on everything, but it's pleasant otherwise.";
	action = END_TALK;	
	code =
		revive_party();
		change_coins(-15);
		relocate_char(get_pc_id(0),46,29,FALSE);
		relocate_char(get_pc_id(1),47,29,FALSE);
		relocate_char(get_pc_id(2),47,30,FALSE);
		relocate_char(get_pc_id(3),46,30,FALSE);
	break;

begintalknode;
	state = 85;
	nextstate = -1;
	condition = 1;
	question = "_I have to go._";
	text1 = "_Hmrrrr. Safe travels._";
	action = END_TALK;


// Burr

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = "Golddale is the home of a first-rate leatherworker, plying his trade on the fine lizard skins found in this area. When you enter, he looks up with a broad grin. _How are ya'?_";
	text2 = "_I'm Burr. I got some great goods, but I can see I got nothin' in stock good enough for the likes of you. But I can make custom work for you. First rate. Let me know!_";
	text5 = "Burr says, _Still makin' custom work! Got plenty of time! Let me know._";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "_Tell me about your custom work._";
	text1 = "_I just need two hundred coins for my labor. And materials. Two to five pieces of quality leather. And a focus crystal to bind it all together. Let me know what you're lookin' for._";

begintalknode;
	state = 130;
	nextstate = 131;
	condition = 1;
	question = "_What can you make for me?_ (Show your materials.)";
	text1 = "He looks at your leather and crystals. _What sort of armor you looking for?_";

begintalknode;
	state = 131;
	nextstate = -1;
	condition = num_of_item(295) >= 1 && num_of_item(294) >= 2;
	question = "_Can you make a leather cloak for me?_ (Give two pieces of fine leather, one focusing crystal, and 200 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Burr takes the materials and sets to work. You settle back and sweat quietly in the hot weather.";
	text3 = "Eventually, he gives you a nice, new cloak. _Good materials. Hope this suits ya'!_";
	action = REUSABLE;
	code =	
		cs();
		if (coins_amount() < 200)
			as(1);
			else {
				as(2); as(3);
				inc_flag(309,18,1);
				change_coins(-200);
				take_num_of_item(294,2);
				take_num_of_item(295,1);
				reward_give(21);
				}
	break;

begintalknode;
	state = 131;
	nextstate = -1;
	condition = num_of_item(295) >= 1 && num_of_item(294) >= 3;
	question = "_Can you make leather armor for me?_ (Give three pieces of fine leather, one focusing crystal, and 200 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Burr takes the materials and sets to work. You settle back and sweat quietly in the hot weather.";
	text3 = "Eventually, he gives you a nice, new leather jerkin. _Good materials. Hope this suits ya'!_";
	action = REUSABLE;
	code =	
		cs();
		if (coins_amount() < 200)
			as(1);
			else {
				as(2); as(3);
				inc_flag(309,18,1);
				change_coins(-200);
				take_num_of_item(294,3);
				take_num_of_item(295,1);
				reward_give(50);
				}
	break;

begintalknode;
	state = 131;
	nextstate = -1;
	condition = num_of_item(295) >= 1 && num_of_item(294) >= 3;
	question = "_Can you make a leather belt for me?_ (Give three pieces of fine leather, one focusing crystal, and 200 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Burr takes the materials and sets to work. You settle back and sweat quietly in the hot weather.";
	text3 = "Eventually, he gives you a nice, new belt. _Good materials. Hope this suits ya'!_";
	action = REUSABLE;
	code =	
		cs();
		if (coins_amount() < 200)
			as(1);
			else {
				as(2); as(3);
				inc_flag(309,18,1);
				change_coins(-200);
				take_num_of_item(294,3);
				take_num_of_item(295,1);
				reward_give(160);
				}
	break;

begintalknode;
	state = 131;
	nextstate = -1;
	condition = num_of_item(295) >= 1 && num_of_item(294) >= 5;
	question = "_Can you make some greaves for me?_ (Give five pieces of fine leather, one focusing crystal, and 200 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Burr takes the materials and sets to work. You settle back and sweat quietly in the hot weather.";
	text3 = "Eventually, he gives you a nice, new pair of greaves. _Good materials. Hope this suits ya'!_";
	action = REUSABLE;
	code =	
		cs();
		if (coins_amount() < 200)
			as(1);
			else {
				as(2); as(3);
				inc_flag(309,18,1);
				change_coins(-200);
				take_num_of_item(294,5);
				take_num_of_item(295,1);
				reward_give(360);
				}
	break;

begintalknode;
	state = 131;
	nextstate = -1;
	condition = num_of_item(295) >= 1 && num_of_item(294) >= 4;
	question = "_Can you make a helmet for me?_ (Give four pieces of fine leather, one focusing crystal, and 200 coins.)";
	text1 = "_I could, but you don't have enough money._";
	text2 = "Burr takes the materials and sets to work. You settle back and sweat quietly in the hot weather.";
	text3 = "Eventually, he gives you a nice, new leather helmet. _Good materials. Hope this suits ya'!_";
	action = REUSABLE;
	code =	
		cs();
		if (coins_amount() < 200)
			as(1);
			else {
				as(2); as(3);
				inc_flag(309,18,1);
				change_coins(-200);
				take_num_of_item(294,4);
				take_num_of_item(295,1);
				reward_give(336);
				}
	break;
	
begintalknode;
	state = 131;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything right now._";
	text1 = "_Well thanks for being honest with me! Good luck to ya'!_";
	action = END_TALK;
